/*
 * @lc app=leetcode.cn id=2042 lang=typescript
 *
 * [2042] 检查句子中的数字是否递增
 */

// @lc code=start
function areNumbersAscending(s: string): boolean {
    const res = s
        .split(" ")
        .map((i) => {
            return parseInt(i);
        })
        .filter((i) => {
            return !Number.isNaN(i);
        });
    for (let i = 1; i < res.length; i++) {
        const prev = res[i - 1];
        const element = res[i];
        if (element <= prev) return false;
    }
    return true;
}
// @lc code=end
